package com.wn.consumer.feign;

import com.wn.bean.User;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author yellow Docter
 * @date 2022 -08-24
 * @desc
 */
@FeignClient(value = "USER-SERVICE",path = "/user")
public interface UserFeignClient {

    // 方法的名称 url 和参数 和返回结果 要和 调用微服的那边一致
    @GetMapping("/{uid}")
    public User findUserById(@PathVariable("uid") Integer uid);

    @PostMapping
    public String saveUser(@RequestBody User user);

    @PutMapping
    public String updateUser(@RequestBody User user);

    @DeleteMapping("/{uid}")
    public String deleteById(@PathVariable("uid") Integer uid);

}
